package com.anjie.powerproject.strategy.pojo.device;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * 用能设备
 */
public class ConsumeDevice extends BaseDevice {
    private List<com.anjie.powerproject.strategy.pojo.device.SupplyDevice> supplyList;

    public ConsumeDevice(Integer id, String name) {
        super(id, name);
        supplyList = new ArrayList<>();
    }

    public ConsumeDevice(BaseDevice device) {
        super(device.getId(), device.getName());
        supplyList = new ArrayList<>();
    }

    public void addSupply(com.anjie.powerproject.strategy.pojo.device.SupplyDevice...supplyDevice) {
        supplyList.addAll(Arrays.asList(supplyDevice));
        for (com.anjie.powerproject.strategy.pojo.device.SupplyDevice device: supplyDevice) {
            device.setSupplyDeviceId(getId());
            device.setSupplyDeviceName(getName());
        }
    }

    public List<com.anjie.powerproject.strategy.pojo.device.SupplyDevice> getSupplyList() {
        return supplyList;
    }
}